//
//  AllNextTableViewCell.m
//  DongChiDaChiProject1
//
//  Created by lanou3g on 15/10/31.
//  Copyright © 2015年 com.lanou3g. All rights reserved.
//

#import "AllNextTableViewCell.h"

@implementation AllNextTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self addView];
    }
    return self;
}

// 添加视图
- (void)addView
{
    // 图片
    self.pictureImageV = [[UIImageView alloc] initWithFrame:CGRectMake(15 * kWidthFitParameter, 10 * kWidthFitParameter, 100 * kWidthFitParameter, 80 * kWidthFitParameter)];
    self.pictureImageV.backgroundColor = [UIColor whiteColor];
    [self.contentView addSubview:_pictureImageV];
    // 标题
    self.myTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.pictureImageV.right + 10 * kWidthFitParameter, self.pictureImageV.top + 3 * kWidthFitParameter, 150 * kWidthFitParameter, 25 * kWidthFitParameter)];
    // self.myTitleLabel.backgroundColor = [UIColor redColor];
    [self.contentView addSubview:_myTitleLabel];
    
    // 收藏
    self.collectLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.myTitleLabel.left, self.myTitleLabel.bottom + 5 * kWidthFitParameter, 80 * kWidthFitParameter, 20 * kWidthFitParameter)];
    // self.collectLabel.backgroundColor = [UIColor redColor];
    // 随机数
    self.collectLabel.text = [NSString stringWithFormat:@"%d收藏", arc4random() % 30000 + 10000];
    self.collectLabel.font = [UIFont systemFontOfSize:14 * kWidthFitParameter];
    self.collectLabel.textColor = [UIColor colorWithHue:0 saturation:0 brightness:0 alpha:0.5];
    [self.contentView addSubview:_collectLabel];
    
    // 浏览
    self.scanLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.collectLabel.right + 10 * kWidthFitParameter, self.collectLabel.top, 90 * kWidthFitParameter, 20 * kWidthFitParameter)];
    self.scanLabel.text = [NSString stringWithFormat:@"%d浏览", arc4random() % 1000000 + 100000];
    self.scanLabel.textColor = [UIColor colorWithHue:0 saturation:0 brightness:0 alpha:0.5];
    self.scanLabel.font = [UIFont systemFontOfSize:14 * kWidthFitParameter];
    //  self.scanLabel.backgroundColor = [UIColor redColor];
    [self.contentView addSubview:_scanLabel];
    
    // 原料
    self.yuanLiaoLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.myTitleLabel.left, self.collectLabel.bottom + 5 * kWidthFitParameter, 230 * kWidthFitParameter, 20 * kWidthFitParameter)];
    self.yuanLiaoLabel.textColor =[UIColor colorWithHue:0 saturation:0 brightness:0 alpha:0.5];
    // self.yuanLiaoLabel.backgroundColor = [UIColor redColor];
    self.yuanLiaoLabel.font = [UIFont systemFontOfSize:14 * kWidthFitParameter];
    [self.contentView addSubview:_yuanLiaoLabel];
    
    
    
    
}

- (void)setAllNextModel:(AllNextModel *)allNextModel
{
    
    
    [self.pictureImageV sd_setImageWithURL:[NSURL URLWithString: allNextModel.albums] placeholderImage:[UIImage imageNamed:@"placehoder.jpg"]];
    self.myTitleLabel.text = allNextModel.title;
    self.yuanLiaoLabel.text = allNextModel.burden;
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
